<!--
 * @Author: windys
 * @Description: 
 * @Date: 2022-03-11 17:05:43
-->
<template>
  <div class="home" v-if="show" v-drag>
    <van-icon name="user-circle-o" size="35" @click="handleHome" />
  </div>
</template>


<script>
import { defineComponent, ref, watch } from "vue";
import { useRouter } from "vue-router";

export default defineComponent({
  setup() {
    const show = ref(false);
    const path = ref("");
    watch(
      () => path.value,
      (v) => {
        const arr = [
          "/live",
          "/article",
          "/crouse",
          "/ques",
          "/invite",
          "/recharge",
          "/set",
          "/consumption",
          "/wencai",
          "/login",
          "/mall",
          "/game",
          "/feedback"
        ];
        if (arr.includes(v)) {
          show.value = true;
        } else {
          show.value = false;
        }
      }
    );
    const router = useRouter()
    const handleHome =()=>{
      router.push('/my')
    }
    return {
      show,
      path,
      handleHome
    };
  },
});
</script>



<style lang="scss" scoped>
.home {
  width: 50px;
  height: 50px;
  position: fixed;
  z-index: 1000000;
  bottom: 85px;
  right: 15px;
  background: #31b1e4;
  border-radius: 50%;
  text-align: center;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.329);
  span {
    font-size: 12px;
  }
}
</style>